<?php

/**
 * Tabela do texto inicial.
 *
 * @author Fernando Dias Oliveira <rodox17@gmail.com>
 * @package lore
 * @subpackage model
 */

class caf09 extends Zend_Db_Table_Abstract  
{
	protected $_table   = "caf09";
	protected $_primary = "caf09_cod_ing";
	
	public function getAll()
	{
		return $this->fetchAll()->toArray();
	}
	
	public function getAllByCod($str_cod, $ped)
	{
		$db = $this->getAdapter();
		
		return $db->fetchAll("SELECT * FROM caf09
							left join caf07 on(caf07_cod = caf09_cod_ing)
							left join caf08 on(caf07_cod = caf08_cod_ing AND caf08_cod_ped = $ped)
							WHERE caf09_cod_prod in($str_cod)");
	}
	
	public function salvar($post)
	{
		return $this->insert($post);
	}
}

?>
